﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace QuickStart
{
	public partial class EditCustomersView : Form, IEditCustomersView
	{
		public EditCustomersView()
		{
			InitializeComponent();
		}

		public EditCustomersPresenter Presenter { get; set; }

		public void SetStatus(string status)
		{
			this.statusBar.Text = status;
		}

		public void SetResults(IEnumerable<Customer> searchResults)
		{
			this.customerSource.DataSource = searchResults;
		}

		private void btnSave_Click(object sender, EventArgs e)
		{
			Presenter.Save((Customer)this.customerSource.Current);
		}

		private void btnSearch_Click(object sender, EventArgs e)
		{
			Presenter.Search(txtSearch.Text);
		}
	}
}